package com.loren.demo29.config;

import com.loren.demo29.data.properties.MinioProperties;
import com.loren.demo29.utils.MinioUtils;
import lombok.AllArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
@AllArgsConstructor
public class BeanConfig {

    private final MinioProperties minioProperties;

    @Bean
    public MinioUtils minioUtils() {
        return new MinioUtils(this.minioProperties.getEndpoint(), this.minioProperties.getAccessKey(), this.minioProperties.getSecretKey());
    }

    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
